package com.jcw.kqxt.controller;

import com.jcw.kqxt.customAnnotation.PermissionVerification;
import com.jcw.kqxt.dto.LoginDto;
import com.jcw.kqxt.result.JSONResult;
import com.jcw.kqxt.service.IloginService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
public class LoginController {

    @Autowired
    private IloginService loginService;

    @PostMapping("/login")
    @ResponseBody
    @PermissionVerification(auth = "login")
    public JSONResult login(@RequestBody LoginDto dto){
        return loginService.login(dto);
    }
}
